<script lang="ts" setup>
import { ref } from 'vue'
const automaticNightReview = ref(false)
const showTime = ref(false)
const automaticNightReviewTime = ref('')
const submit = function () {
  uni.navigateBack()
}
</script>

<template>
  <u-cell-group
    :customStyle="{
      'font-size': '32rpx',
      'font-family': 'SourceHanSansCN-Regular-, SourceHanSansCN-Regular',
      'background-color': '#fff',
      'margin-top': '24rpx'
    }"
  >
    <u-cell title="自动夜审" size="large">
      <template #value>
        <u-switch v-model="automaticNightReview" size="40"></u-switch>
      </template>
    </u-cell>
    <u-cell
      v-if="automaticNightReview"
      title="自动夜审时间"
      size="large"
      isLink
      clickable
      @click="showTime = true"
      :value="automaticNightReviewTime"
      :rightIconStyle="{
        width: '9rpx',
        height: '18rpx',
        'font-weight': 'bold'
      }"
    ></u-cell>
  </u-cell-group>
  <u-datetime-picker
    :show="showTime"
    v-model="automaticNightReviewTime"
    mode="time"
    @cancel="showTime = false"
    @confirm="showTime = false"
    itemHeight="100"
  ></u-datetime-picker>

  <view style="margin: 24rpx 24rpx 0; width: 700rpx !important">
    <u-button @click="submit" type="primary">提交</u-button>
  </view>
  <navigator open-type="navigateBack">
    <u-button @click="">取消</u-button>
  </navigator>
</template>

<style lang="scss" scoped>
:deep(.u-button--square) {
  margin-top: 24rpx;
  width: 700rpx !important;
}
</style>
